/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package sunsite.service;

import java.util.List;
import java.util.Map;
import sunsite.po.Resource;
import sunsite.po.ResourceCatelog;
import sunsite.po.ResourceTp;
import sunsite.po.ResourceType;
import sunsite.dao.FileDao;
import sunsite.po.DownloadHistory;
import sunsite.tools.Pagination;

/**
 *
 * @author Administrator
 */
public class FileServiceImpl implements FileService{
    private FileDao fileDao;
    
    public List<Resource> getAllResource() {
        return getFileDao().getAllResource();
    }

    public List<ResourceTp> getAllResourceTp() {
        return getFileDao().getAllResourceTp();
    }

    public List<ResourceCatelog> getAllResourceCatelog() {
        return getFileDao().getAllResourceCatelog();
    }

    public ResourceCatelog getResourceCatelog(int catId) {
        return getFileDao().getResourceCatelog(catId);
    }

    public List<ResourceType> getAllResourceType() {
        return getFileDao().getAllResourceType();
    }

    public FileDao getFileDao() {
        return fileDao;
    }

    public void setFileDao(FileDao fileDao) {
        this.fileDao = fileDao;
    }

    public List<ResourceCatelog> getResourceCatelogList(int tpId) {
        return getFileDao().getResourceCatelogList(tpId);
    }

    public List<ResourceType> getResourceTypeList(int catId) {
        return getFileDao().getResourceTypeList(catId);
    }

    public void addResourceType(ResourceType resourceType) {
        getFileDao().addResourceType(resourceType);
    }

    public void addResource(Resource resource) {
        getFileDao().addResource(resource);
    }

    public void modifyResource(Resource resource){
        getFileDao().modifyResource(resource);
    }

    public void addDownloadHistory(DownloadHistory downloadHistory){
        getFileDao().addDownloadHistory(downloadHistory);
    }
    public ResourceType getResourceType(int typeid) {
        return getFileDao().getResourceType(typeid);
    }

    public void deleteResource(String resid) {
        getFileDao().deleteResource(resid);
    }

    public List<Resource> getResourceList(Pagination pagination) {
        return getFileDao().getResourceList(pagination);
    }
    public List<Resource> getResourceList(final Pagination pagination,Map map){
        return getFileDao().getResourceList(pagination, map);
    }
    public Resource getResource(String resId){
        return getFileDao().getResource(resId);
    }

}
